__________________________________________________________________________________________________
class Solution {
public:
    int numRollsToTarget(int d, int f, int target) {
        int a[35][1005],i,j,k;
        memset(a,0,sizeof(a));
        a[0][0]=1;
        for(i=1;i<=d;i++)for(j=1;j<=f;j++)for(k=j;k<=target;k++)a[i][k]=(a[i][k]+a[i-1][k-j])%1000000007;
        return a[d][target];
    }
};
__________________________________________________________________________________________________

__________________________________________________________________________________________________
